﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Circle.Domain.Interface.UnitOfWork;
using Circle.Domain.Interface;
using System.Data.Entity;

namespace Circle.Data.UnitOfWork
{
    public class UnitOfWorkManager : IUnitOfWorkManager
    {
        private bool _isDisposed;
        private readonly CircleDbContext _context;

        public UnitOfWorkManager(ICircleDbContext context)
        {

            _context = context as CircleDbContext;
        }

        public IUnitOfWork NewUnitOfWork()
        {
            return new UnitOfWork(_context);
        }

        public void Dispose()
        {
            if (!_isDisposed)
            {

                _isDisposed = true;
            }
        }
    }
}
